String[] projData = loadStrings("projects.txt"); //load the data from file

// Declare and create the array
Block[] projs = new Block[projData.length];

void setup() {
  size(1000, 500);
  smooth();
  noStroke();
  for (int i = 0; i < projs.length; i++) {
    float x = 10 + i*60;
    float y = 10;
    // create new object
    projs[i] = new Block(x, y, 15);
  }
}

void draw() {
  background(0);
  for (int i = 0; i < projs.length; i++) {
    projs[i].display(); //display each object
    //println(i);
  }
  //println("I thought about drawing");
}

/*

int dragX, dragY;

void setup() {
    size(2010,500);
    noLoop();
  
    String[] lines = loadStrings("projects.txt");

    for (int i = 0; i < lines.length; i++) {
        println(lines[i]);
    }
}

void draw() {
    background(220);
    
    fill(200);
    rect(5,5,1000,100);

    fill(200);
    rect(5,110,1000,200);

    fill(100);  
    rect(dragX,dragY,100,100); // smaller block of data
    
    for (int i = 0; i < 10; i++) {
        rect(300,i*25,i,20);
        println("made it!");
    }
  
    println(mouseX + " : " + mouseY);
}

void mouseDragged() {  // move data block
  redraw();
  dragX = mouseX;
  dragY = mouseY;
}

*/
class Block {
  float x, y, length;
  
  Block(float xpos, float ypos, float lineSize) {
    x = xpos;
    y = ypos;
    length = lineSize;
  }
  
  void display() {
    rect(x, y, length, 30);
    //println("I'm drawing!");
  }
}

